home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
VRML 2.0 Sourcebook (2nd Edition)
/
VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso
/
book
/
mac
/
ch08
/
08fig07.wrl
< prev
next >
Wrap
Text File
|
1996-09-23
|
1KB
|
66 lines
#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright 1997 By
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Group {
children [
# Three rotating bars
DEF Bar1 Transform {
children Shape {
appearance DEF White Appearance {
material Material { }
}
geometry Box { size 1.5 0.2 0.2 }
}
},
DEF Bar2 Transform {
children Shape {
appearance USE White
geometry Box { size 0.2 1.5 0.2 }
}
},
DEF Bar3 Transform {
children Shape {
appearance USE White
geometry Box { size 0.2 0.2 1.5 }
}
},
# Animation clock
DEF Clock TimeSensor {
cycleInterval 4.0
loop TRUE
},
# Animation paths, one for each bar
DEF BarPath1 OrientationInterpolator {
key [ 0.0, 0.50, 1.0 ]
keyValue [
0.0 0.0 1.0 0.0,
0.0 0.0 1.0 3.14,
0.0 0.0 1.0 6.28
]
},
DEF BarPath2 OrientationInterpolator {
key [ 0.0, 0.50, 1.0 ]
keyValue [
1.0 0.0 0.0 0.0,
1.0 0.0 0.0 3.14,
1.0 0.0 0.0 6.28
]
},
DEF BarPath3 OrientationInterpolator {
key [ 0.0, 0.50, 1.0 ]
keyValue [
0.0 1.0 0.0 0.0,
0.0 1.0 0.0 3.14,
0.0 1.0 0.0 6.28
]
}
]
}
ROUTE Clock.fraction_changed TO BarPath1.set_fraction
ROUTE Clock.fraction_changed TO BarPath2.set_fraction
ROUTE Clock.fraction_changed TO BarPath3.set_fraction
ROUTE BarPath1.value_changed TO Bar1.set_rotation
ROUTE BarPath2.value_changed TO Bar2.set_rotation
ROUTE BarPath3.value_changed TO Bar3.set_rotation